package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.AlbumDAO;
import cn.nebula.music.domain.Album;
@Component
public class StringToAlbumsConverter implements Converter<String,Album>{

	@Autowired
	private AlbumDAO albumDAO;
	
	@Override
	public Album convert(String source) {
		return albumDAO.findAlbumById(Integer.valueOf(source));
	}

}
